<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title></title>
<style type="text/css">
    body {
        background-color: #000;
        font-size: 12px;
    }

    td img {
        display: block;
    }

    input {
        width: 150px;
        height: 16px;
    }

    #main {
        width: 1024px;
        margin: 0 auto;
    }

    #show {
        position: relative;
        top: 375px;
        left: 280px;
        width: 480px;
       /* height: 400px;*/
    }

    #submitbtn {
        margin-left: 100px;
        width: 160px;
        height: 50px;
    }

    .normal {
        padding-left: 15px;
        color: black;
    }

    .error {
        padding-left: 15px;
        color: red;
    }
</style>
<script type="text/javascript">
var uri = window.location.pathname;
var uriInfo = uri.split("");
var platformId = parseInt(uriInfo[2]);
var unionId = parseInt(uriInfo[3]);
var linkId = parseInt(uriInfo[4].substring(0, uriInfo[4].indexOf(".")));

var _title = '37wan龙将-惊世史诗神作，带你回归经典三国';
var adParam = '5106bdzl';
var flashPath = 'img/swfs/a6/5106bdzl/';
var flashFile = flashPath + 'index.swf';
var flashVars = "path=" + flashPath;
var _width = '1000';
var _height = '600';
var gameId = '88';
var gameServerId = '9153';
var referer = 'baidu_tg';
var uid = getParam("uid").replace(/\./g,'_');
var ext = getParam('ext');


var TimeTemp = 1369124588;
var platformId = 1;
var platformDeploy=1;
var platformDomain='regapi.37wan.com';
document.write('<script type="text/javascript" charset="utf-8" src="js/'+platformDeploy+'/g.js?'+Math.random()+'"><\/script>');
var step = 0;
var space = '';
for (var i = 0; i <= _title.length; i++)space += '　';

function $(id) {
    return document.getElementById(id);
}

function getParam(param) {
    var uri = window.location.search;
    var re = new RegExp("" + param + "=([^&?]*)", "ig");
    return ((uri.match(re)) ? (decodeURIComponent(uri.match(re)[0].substr(param.length + 1))) : '');
}


function flash_title() {
	step++;
	if (step == 3) {
		step = 1
	}
	if (step == 1) {
		document.title = space
	}
	if (step == 2) {
		document.title = _title
	}
	setTimeout("flash_title()", 500);
}
flash_title();
function loadAdTrack() {Jsonp("680/5.js?uid=" + uid, null);}

function loadTrack() {
    Jsonp("680/2.js?uid=" + uid, null);
    window.moveTo(0, 0);
    window.resizeTo(screen.width, screen.height);
	var oldusername = Cookies.get('pusername','');
	if (oldusername != '') { 
		document.getElementById('login_account').value = oldusername;
		document.getElementById('tr_password1').style.display = "none";
		document.getElementById('tr_olduser_notice').style.display = "block";
		$('tr_cxzc').style.display = "";
	}
	
}

function openDiv() {
    $('show').style.display = "block";
    Jsonp("680/3.js?uid=" + uid, null);
}

var CallBackHandler = {
    tid: 0,
    callbacks: {},
    getTid: function() {
        return ++this.tid;
    },
    registerCallBack: function(tid, func) {
        this.callbacks[tid] = func;
    },
    handleCallBack: function(tid, data) {
        var func = this.callbacks[tid];
        if (func && (typeof func == 'function')) func(data);
        var script = document.getElementById('jsonp_invoker_' + tid);
        if (script) try {
            script.parentNode.removeChild(script);
        } catch(e) {
        }
    }
};

var Jsonp = function(url, callback) {
    var tid = CallBackHandler.getTid();
    var script = document.createElement('script');
    with (script) {
        id = 'jsonp_invoker_' + tid;
        type = 'text/javascript';
        src = url.indexOf('?') > 0 ? (url + '&tid=' + tid+'&'+Math.random()) : (url + '?tid=' + tid+'&'+Math.random());
    }
    if (callback) CallBackHandler.registerCallBack(tid, callback);
    var head = document.getElementsByTagName('head');
    if (head[0]) {
        head[0].appendChild(script);
    } else {
        document.body.appendChild(script);
    }
};

function successInfo(id, message) {
    $(id).className = 'normal';
    $(id).innerHTML = message;
    return true;
}

function errorInfo(id, message) {
    $(id).className = 'error';
    $(id).innerHTML = message;
    return false;
}

function checkLoginAccount(value) {
    return /^[A-Za-z0-9_]{4,20}$/.test(value) ? successInfo('u_info', '<font style="color:#008000;">帐号填写正确！</font>') : errorInfo('u_info', '！4-20个字符,由字母或数字组成');
}

function checkPassword(value) {
    return /^[\x01-\xfe]{6,20}$/.test(value) ? successInfo('w_info', '<font style="color:#008000;">密码填写正确！</font>') : errorInfo('w_info', '！长度6-20个字符');
}

function checkPassword1(value) {
    return (/^[\x01-\xfe]{6,20}$/.test(value)) ? (($('password').value == value) ? successInfo('p_info', '两次填写的密码一致！') : errorInfo('p_info', '两次填写的密码不一致！')) : errorInfo('p_info', '！长度6-20个字符');
}

function checkSubmit(){
	if (event.keyCode == 13) {
		checkForm($("register_form"));
	}
}

var Cookies = {
    aliases: {},
    alias: function(alias, name, defaultValue) {

        Cookies.aliases[alias] = name;
        Cookies[alias] = function(value, days) {
            if (value == null)
                return Cookies.get(name, defaultValue);
            else
                Cookies.set(name, value, days);
        }

    },
    set: function(name, value, days) {

        name = Cookies.aliases[name] || name;
        var expires = '';

        if (!isNaN(days)) {
            var date = new Date();
            date.setTime(date.getTime() + days * 24 * 60 * 60 * 1000);
            expires = "; expires=" + date.toGMTString();
        }
        document.cookie = name + "=" + escape(value) + expires + "; path=/";

    },
    get: function(name, defaultValue) {

        name = Cookies.aliases[name] || name;

        var regex = new RegExp(name + "s*=s*(.*?)(;|$)");
        var cookies = document.cookie.toString();
        var match = cookies.match(regex);

        if (match) return unescape(match[1]);

        return defaultValue;

    },

    erase: function(name) {
        Cookies.set(name, '', -1);
    }

};

function clearCookie(){
Cookies.set('pusername','',-1);
document.getElementById('tr_password1').style.display = "";
document.getElementById('tr_olduser_notice').style.display = "none";
document.getElementById('tr_cxzc').style.display = "none";
document.getElementById('login_account').value = "";

}


function checkForm(form) {

    loginAccount = form.login_account.value;
    var password = form.password.value;

    if (!checkLoginAccount(loginAccount)) return false;
    if (!checkPassword(password)) return false;
	var oldusername = Cookies.get('pusername','');
	if (oldusername == ''){
		if (!checkPassword1(form.password1.value)) return false;
	}
    

	if($('checkservice')){
		if (!$('checkservice').checked){$('agreement').style.color='red';return false}
		else{$('agreement').style.color='black';}
	}
	    $('submitbtn').disabled = true;
    $('u_info').innerHTML = '请稍候...';

    var url = "/"+platformDomain+"/api/p_register.php?login_account=" + encodeURIComponent(loginAccount) +
            "&password=" + encodeURIComponent(password) +
            "&ad_param=" + encodeURIComponent(adParam) +
            "&referer=" + encodeURIComponent(referer) +
            "&referer_param=" + encodeURIComponent(uid) +
            "&game_id=" + gameId +
            "&game_server_id=" + gameServerId +
                "&ad_type=" + parseInt(getParam('ad_type'),10) +
            "&ext=" + encodeURIComponent(platformId + "|" + unionId + "|" + linkId + "|" + uid);

    Jsonp(url, function(data) {
        if (data.success == 0) {
            Cookies.set('pusername',loginAccount,365); 
            window.location = data.url;
        } else {
	if($('checkservice')){
		if (!$('checkservice').checked){$('agreement').style.color='red';return false}
		else{$('agreement').style.color='black';}
	}
	            $('submitbtn').disabled = false;
            $('u_info').className = 'error';
            $('u_info').innerHTML = data.message;
        }
    });

    return false;
}
</script>
</head>
<body onload="loadTrack();loadOther();">
<div id="main">
    <div id="flash" style="position:absolute;">
        <table border="0" cellpadding="0" cellspacing="0" width="900" align="center">
            <tr>
                <td>
                    <script type="text/javascript">
                        document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="/fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="' + _width + '" height="' + _height + '" id="game" align="middle">');
                        document.write('<param name="allowScriptAccess" value="always" />');
                        document.write('<param name="movie" value="' + flashFile + '" />');
                        document.write('<param name="quality" value="high" />');
                        document.write('<param name="bgcolor" value="#000000" />');
                        document.write('<param name="FlashVars" value="' + flashVars + '" />');
                        document.write('<param name="wmode" value="transparent" />');
                        document.write('<embed src="' + flashFile + '"  FlashVars="' + flashVars + '" quality="high" bgcolor="#000000" width="' + _width + '" height="' + _height + '" name="game" align="middle" allowScriptAccess="always" type="application/x-shockwave-flash" pluginspage="/www.macromedia.com/go/getflashplayer"  wmode="transparent" />');
                        document.write('</object>');
                    </script>
                </td>
            </tr>
        </table>
    </div>
    <div id="show"   >
        <form id="register_form" style="margin:0" action="http://www.775sa.net/Account/lj_tg.html" method="post"  target="_blank">
			<span id="tr_olduser_notice" style="display:none;color:red;"><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;欢迎您回来，目前有<script language="javascript" type="text/javascript">document.write(Math.floor(Math.random()*100000+10000));</script>位MM玩家想和您一起游戏</span>
            <table width="480" border="0" align="center" cellpadding="0" cellspacing="0">
                <tr>
                    <td width="100" height="40" align="right"><label for="login_account">用户名：</label></td>
                    <td width="149">
                        <input type="text" class="text" id="login_account" name="user"
                               onblur="checkLoginAccount(this.value);"/>
                    </td>
                    <td width="231" class="normal" id="u_info">4-20个字符,由字母或数字组成</td>
                </tr>
                <tr>
                    <td height="40" align="right"><label for="password">登录密码：</label></td>
                    <td><input id="password" type="password" name="password" class="text"
                               onblur="checkPassword(this.value);"/></td>
                    <td class="normal" id="w_info">长度6-20个字符</td>
                </tr>
				<tr id="tr_cxzc" style="display:none;">
                    <td></td><td></td><td>&nbsp;&nbsp;&nbsp;&nbsp;<font color="blue"><a href="javascript: clearCookie();">重新注册</a></font></td>
                </tr>
                <tr id="tr_password1">
                    <td height="40" align="right"><label for="password1">重复密码：</label></td>
                    <td><input id="password1" type="password" name="password2" class="text"
                               onblur="checkPassword1(this.value);" onkeypress="checkSubmit();"/></td>
                    <td class="normal" id="p_info">两次输入的密码请保持一致</td>
                </tr>
                <tr>
					<script language="javascript">
						if(typeof(_SET_37.agreement)!='undefined'&&_SET_37.agreement.status==1){
							document.write(_SET_37.agreement.str);
						}else{
							document.write('<td height="10">&nbsp;</td>');
						}
					</script>
					                </tr>
                <tr>
                    <td height="60" colspan="3" align="left" class="btn">
                        <input type="image" name="SubmitBtn" src="img/swfs/a6/5106bdzl/btn.gif" id="submitbtn"/>
                    </td>
					 <td height="40"  align="center" style="white-space:nowrap;">
					<a id="aid" style="display:none;" href='#' onClick="javascript:addFavorite(urls,'37wan《墨攻》')">收藏有礼</a>
					</td>
                </tr>
                <tr>
                    <td colspan="3"></td>
                </tr>
            </table>
        </form>
    </div>
	<div id="divolduser"></div>
</div>
<script language="javascript" type="text/javascript"> 
var addFavorite = function(url,title){
if(document.all)
window.external.AddFavorite(url, title);
else if (window.sidebar)
window.sidebar.addPanel(title,url, "")
}
</script>
<script language="javascript" type="text/javascript"> 
if(gameId==38){
var urls='/mogong.37wan.com';
document.getElementById("aid").style.display="block";
}
</script>
<!--显示用户名-->

</body>
</html>